﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DapperRealize;

namespace DapperTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入学号");
            string input = Console.ReadLine();
            Console.WriteLine(GetStudentById(Convert.ToInt32(input)).StuName);

            Console.ReadLine();
        }
        static Student GetStudentById(int stuId)
        {
            DapperHelper helper = new DapperHelper("Server =.; DataBase = StuScript; Uid = sa; Pwd = lmz8816766");
            string sql = "select * from StudentInfo where stuId=@stuId";
            var student = helper.QueryFirst<Student>(sql, new {stuId});
            return student;
        }
    }
}
